3.289 \(\int \cos (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx\)

Optimal. Leaf size=60 \[ \frac {a^2 A \sin (c+d x)}{d}+\frac {b (2 a B+A b) \tanh ^{-1}(\sin (c+d x))}{d}+a x (a B+2 A b)+\frac {b^2 B \tan (c+d x)}{d} \]

[Out]

a*(2*A*b+B*a)*x+b*(A*b+2*B*a)*arctanh(sin(d*x+c))/d+a^2*A*sin(d*x+c)/d+b^2*B*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {4024, 3770, 3767, 8} \[ \frac {a^2 A \sin (c+d x)}{d}+\frac {b (2 a B+A b) \tanh ^{-1}(\sin (c+d x))}{d}+a x (a B+2 A b)+\frac {b^2 B \tan (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*(a + b*Sec[c + d*x])^2*(A + B*Sec[c + d*x]),x]

[Out]

a*(2*A*b + a*B)*x + (b*(A*b + 2*a*B)*ArcTanh[Sin[c + d*x]])/d + (a^2*A*Sin[c + d*x])/d + (b^2*B*Tan[c + d*x])/
d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4024

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^2*(csc[(e_.) + (f_.)*(x_)]*(B_
.) + (A_)), x_Symbol] :> Simp[(a^2*A*Cos[e + f*x]*(d*Csc[e + f*x])^(n + 1))/(d*f*n), x] + Dist[1/(d*n), Int[(d
*Csc[e + f*x])^(n + 1)*(a*(2*A*b + a*B)*n + (2*a*b*B*n + A*(b^2*n + a^2*(n + 1)))*Csc[e + f*x] + b^2*B*n*Csc[e
 + f*x]^2), x], x] /; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a*B, 0] && NeQ[a^2 - b^2, 0] && LeQ[n, -1]

Rubi steps

\begin {align*} \int \cos (c+d x) (a+b \sec (c+d x))^2 (A+B \sec (c+d x)) \, dx &=\frac {a^2 A \sin (c+d x)}{d}-\int \left (-a (2 A b+a B)+\left (-A b^2-2 a b B\right ) \sec (c+d x)-b^2 B \sec ^2(c+d x)\right ) \, dx\\ &=a (2 A b+a B) x+\frac {a^2 A \sin (c+d x)}{d}+\left (b^2 B\right ) \int \sec ^2(c+d x) \, dx+(b (A b+2 a B)) \int \sec (c+d x) \, dx\\ &=a (2 A b+a B) x+\frac {b (A b+2 a B) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a^2 A \sin (c+d x)}{d}-\frac {\left (b^2 B\right ) \operatorname {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d}\\ &=a (2 A b+a B) x+\frac {b (A b+2 a B) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a^2 A \sin (c+d x)}{d}+\frac {b^2 B \tan (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.49, size = 109, normalized size = 1.82 \[ \frac {a^2 A \sin (c+d x)+a (c+d x) (a B+2 A b)-b (2 a B+A b) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+b (2 a B+A b) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )+b^2 B \tan (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*(a + b*Sec[c + d*x])^2*(A + B*Sec[c + d*x]),x]

[Out]

(a*(2*A*b + a*B)*(c + d*x) - b*(A*b + 2*a*B)*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + b*(A*b + 2*a*B)*Log[Co
s[(c + d*x)/2] + Sin[(c + d*x)/2]] + a^2*A*Sin[c + d*x] + b^2*B*Tan[c + d*x])/d

________________________________________________________________________________________

fricas [A]  time = 0.48, size = 117, normalized size = 1.95 \[ \frac {2 \, {\left (B a^{2} + 2 \, A a b\right )} d x \cos \left (d x + c\right ) + {\left (2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (A a^{2} \cos \left (d x + c\right ) + B b^{2}\right )} \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(2*(B*a^2 + 2*A*a*b)*d*x*cos(d*x + c) + (2*B*a*b + A*b^2)*cos(d*x + c)*log(sin(d*x + c) + 1) - (2*B*a*b +
A*b^2)*cos(d*x + c)*log(-sin(d*x + c) + 1) + 2*(A*a^2*cos(d*x + c) + B*b^2)*sin(d*x + c))/(d*cos(d*x + c))

________________________________________________________________________________________

giac [B]  time = 0.28, size = 154, normalized size = 2.57 \[ \frac {{\left (B a^{2} + 2 \, A a b\right )} {\left (d x + c\right )} + {\left (2 \, B a b + A b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (2 \, B a b + A b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="giac")

[Out]

((B*a^2 + 2*A*a*b)*(d*x + c) + (2*B*a*b + A*b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - (2*B*a*b + A*b^2)*log(ab
s(tan(1/2*d*x + 1/2*c) - 1)) + 2*(A*a^2*tan(1/2*d*x + 1/2*c)^3 - B*b^2*tan(1/2*d*x + 1/2*c)^3 - A*a^2*tan(1/2*
d*x + 1/2*c) - B*b^2*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^4 - 1))/d

________________________________________________________________________________________

maple [A]  time = 0.87, size = 104, normalized size = 1.73 \[ 2 A x a b +a^{2} B x +\frac {a^{2} A \sin \left (d x +c \right )}{d}+\frac {A \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {2 A a b c}{d}+\frac {b^{2} B \tan \left (d x +c \right )}{d}+\frac {2 B a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {B \,a^{2} c}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x)

[Out]

2*A*x*a*b+a^2*B*x+1/d*a^2*A*sin(d*x+c)+1/d*A*b^2*ln(sec(d*x+c)+tan(d*x+c))+2/d*A*a*b*c+b^2*B*tan(d*x+c)/d+2/d*
B*a*b*ln(sec(d*x+c)+tan(d*x+c))+1/d*B*a^2*c

________________________________________________________________________________________

maxima [A]  time = 0.91, size = 103, normalized size = 1.72 \[ \frac {2 \, {\left (d x + c\right )} B a^{2} + 4 \, {\left (d x + c\right )} A a b + 2 \, B a b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + A b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, A a^{2} \sin \left (d x + c\right ) + 2 \, B b^{2} \tan \left (d x + c\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))^2*(A+B*sec(d*x+c)),x, algorithm="maxima")

[Out]

1/2*(2*(d*x + c)*B*a^2 + 4*(d*x + c)*A*a*b + 2*B*a*b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + A*b^2*(
log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 2*A*a^2*sin(d*x + c) + 2*B*b^2*tan(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 2.55, size = 163, normalized size = 2.72 \[ \frac {B\,b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {2\,B\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,A\,b^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{2\,d\,\cos \left (c+d\,x\right )}+\frac {4\,A\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,B\,a\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)*(A + B/cos(c + d*x))*(a + b/cos(c + d*x))^2,x)

[Out]

(B*b^2*tan(c + d*x))/d + (2*B*a^2*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (2*A*b^2*atanh(sin(c/2 + (d
*x)/2)/cos(c/2 + (d*x)/2)))/d + (A*a^2*sin(2*c + 2*d*x))/(2*d*cos(c + d*x)) + (4*A*a*b*atan(sin(c/2 + (d*x)/2)
/cos(c/2 + (d*x)/2)))/d + (4*B*a*b*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (A + B \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{2} \cos {\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a+b*sec(d*x+c))**2*(A+B*sec(d*x+c)),x)

[Out]

Integral((A + B*sec(c + d*x))*(a + b*sec(c + d*x))**2*cos(c + d*x), x)

________________________________________________________________________________________